home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-12-08 | 3.3 KB | 98 lines | [TEXT/ALFA] |
-
- alpha::mode Ada 1.0 dummyAda {*.ada *.ads *.adb *.ADS *.ADB *_.a *.a }
-
- #===============================================================================
- # From Raymond Waldrop <rwaldrop@cs.tamu.edu>
- #===============================================================================
-
- newPref f elecRBrace {1} Ada
- newPref v leftFillColumn {3} Ada
- newPref v prefixString {-- } Ada
- newPref f electricSemi {1} Ada
- newPref v wordBreak {[a-zA-Z0-9_]+} Ada
- newPref f elecLBrace {1} Ada
- newPref f wordWrap {0} Ada
- newPref v funcExpr {^[ \t]*(procedure|function)[ \t]+([A-Za-z][A-Za-z0-9_]*)} Ada
- newPref v parseExpr {^[ \t]*[^ \t]+[ \t]+([A-Za-z][A-Za-z0-9_]*)} Ada
- newPref v wordBreakPreface {[^a-zA-Z0-9_]} Ada
- newPref f electricTab {0} Ada
-
- # Don't get used!
- #set adaCommentRegexp {/\*(([^*]/)|[^*]|\r)*\*/}
- #set adaPreRegexp {^\#[\t ]*[a-z]*}
- set adaKeyWords {
- abort abs accept access all and array at begin body case constant
- declare delay delta digits do else elsif end entry exception exit
- for function generic goto others if in is limited loop mod new not
- null of or subtype out package pragma private procedure raise range
- record rem renames return reverse select separate task terminate
- then type use when while with xor = /= := > < abstract aliased
- protected requeue tagged until
- }
- regModeKeywords -e {--} -c magenta -k blue Ada $adaKeyWords -i ")" -i "(" -i ":" -i ";" -i "," -i "." -I blue
-
- proc dummyAda {} {}
-
- #===============================================================================
- # From Tom Konantz
- #===============================================================================
-
- proc Ada::MarkFile {} {
- global AdamodeVars
- set pos 0
-
- while {![catch {search -s -f 1 -r 1 -m 0 -i 1 $AdamodeVars(funcExpr) $pos} res]} {
- set start [lindex $res 0]
- set end [expr [lindex $res 1] + 1]
- set text [getText $start $end]
-
- if {[regexp -nocase -indices {(procedure|function)[ \t]+([a-zA-Z0-9_]+)} $text dummy dummy0 pname]} {
- set i1 [expr [lindex $pname 0] + $start]
- set i2 [expr [lindex $pname 1] + $start + 1]
- set word [getText $i1 $i2]
- set tmp [concat $i1 $i2]
-
- if {[info exists cnts($word)]} {
- # This section handles duplicate. i.e., overloaded names
- set cnts($word) [expr $cnts($word) + 1]
- set ol_word [ join [concat $word "#" $cnts($word)] ""]
- set inds($ol_word) $tmp
- } else {
- set cnts($word) 1
- set inds($word) $tmp
- }
- }
-
-
- set pos $end
- }
- if {[info exists inds]} {
- foreach f [lsort -ignore [array names inds]] {
- set res $inds($f)
- setNamedMark $f [lineStart [lindex $res 0]] [lindex $res 0] [lindex $res 1]
- }
- }
- }
-
- # the following will switch between the Ada spec & body,
- # assuming they're in the same directory
- # and use either GNAT or VAX Ada naming conventions.
- # other conventions can be supported fairly easily.
- proc otherPart {} {
- set curname [win::Current]
- if {[regsub "(.*)\.ads" $curname {\1.adb} tgtname]} {
- openFileQuietly $tgtname
- } elseif {[regsub "(.*)\.adb" $curname {\1.ads} tgtname]} {
- openFileQuietly $tgtname
- # Next clause must precede the one after it!
- } elseif {[regsub {(.*)_\.a$} $curname {\1.a} tgtname]} {
- openFileQuietly $tgtname
- } elseif {[regsub {(.*)\.a$} $curname {\1_.a} tgtname]} {
- openFileQuietly $tgtname
- } else {
- error "NoMatch"
- }
- }
-
- bind f9 otherPart Ada
-